<!--
 * @Authoer: dusong
 * @Description:逻辑系统管理
 * @Date 2017/12/5 14:16
 * @Modified By:
 *
-->
<div id="logicSys">
	<yu-panel :title="$t('logicSysManager.ljxtgl')">
		<yu-toolBar>
			<el-button @click="handleModify('edit')">{{ $t('logicSysManager.xg') }}</el-button>
			<el-button @click="setCrelStra">{{ $t('logicSysManager.szrzcl') }}</el-button>
			<el-button @click="handleModify('valid')">{{ $t('logicSysManager.sx') }}</el-button>
			<el-button @click="handleModify('invalid')">{{ $t('logicSysManager.sx1') }}</el-button>
		</yu-toolBar>
		<!-- 逻辑系统列表-->
		<el-table-x ref="mytable" :radiobox='true' :max-height="mainGrid.height" :data-url="mainGrid.dataUrl" :data-params="mainGrid.dataParams"
		 :table-columns="mainGrid.tableColumns" @row-click="rowClickFn">
		</el-table-x>
	</yu-panel>
	<!-- 逻辑系统编辑框-->
	<el-dialog-x :center="true" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
		<el-form-x ref="myform" :group-fields="updateFields" :disabled="formDisabled" label-width="120px"></el-form-x>
		<div slot="footer" class="dialog-footer" align="center">
			<el-button v-if="dialogStatus=='create'" type="primary" @click="saveCreateFn()">{{ $t('logicSysManager.bc') }}</el-button>
			<el-button v-if="dialogStatus=='update'" type="primary" @click="saveEditFn()">{{ $t('logicSysManager.bc') }}</el-button>
			<el-button @click="dialogFormVisible = false">{{ $t('logicSysManager.gb') }}</el-button>
		</div>
	</el-dialog-x>

	<!-- 认证信息列表 -->
	<el-dialog-x :center="true" :title="textMap[dialogStatus]" :visible.sync="dialogAuthVisible" :before-close="closeAuthViewFn">
		<yu-toolBar>
			<el-button @click="openAuthCreateFn">{{ $t('logicSysManager.xz') }}</el-button>
			<el-button @click="handleAuthModify('edit')">{{ $t('logicSysManager.xg') }}</el-button>
			<el-button @click="handleAuthModify('delete')">{{ $t('logicSysManager.sc') }}</el-button>
		</yu-toolBar>

		<el-table-x ref="mytableAuth" :checkbox="true" :max-height="authGrid.height" :data-url="authGrid.dataUrl" :data-params="authGrid.dataParams"
		 :table-columns="authGrid.tableColumns" @row-click="rowClickFn">
		</el-table-x>

		<div slot="footer" class="dialog-footer">
			<el-button @click="closeAuthViewFn">{{ $t('logicSysManager.gb') }}</el-button>
		</div>
	</el-dialog-x>

	<!--认证信息编辑框-->
	<el-dialog-x :center="true" :title="textMap[dialogStatus]" :visible.sync="dialogAuthEditVisible">
		<el-form-x ref="authDialogform" :group-fields="authGrid.updateFields" :disabled="formDisabled" label-width="120px"></el-form-x>
		<div slot="footer" class="dialog-footer" align="center">
			<el-button type="primary" @click="saveAuthEditFn()">{{ $t('logicSysManager.bc') }}</el-button>
			<el-button @click="dialogAuthEditVisible = false">{{ $t('logicSysManager.gb') }}</el-button>
		</div>
	</el-dialog-x>

	<!--认证策略-->
	<el-dialog-x :center="true" :title="textMap[dialogStatus]" :visible.sync="dialogCrelVisible" width="800px" height="400px">
		<el-form :model="crel" ref="crel" :rules="rules" label="left" :inline="true" label-width="130px" style="margin-right: 1px; ">
			<el-tabs v-model="crelTabs" type="card">
				<el-tab-pane :label="$t('logicSysManager.dlcl')" name="loginTab">
					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!-- 1/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.scdlcl')">
								<el-checkbox v-model="crel.loginFirstRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.scdlqzxgkl')" label-width="190px">
								<el-radio-group v-model="crel.loginFirstRule.passwdChgFlag" :disabled="!crel.loginFirstRule.flag">
									<el-radio label="1">{{ $t('logicSysManager.s') }}</el-radio>
									<el-radio label="0">{{ $t('logicSysManager.f') }}</el-radio>
								</el-radio-group>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--2/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.dlcl')">
								<el-checkbox v-model="crel.loginIpRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.dlycrzglzx')" label-width="190px">
								<el-select size="small" v-model="crel.loginIpRule.actionType" style="width:100px;" :disabled="!crel.loginIpRule.flag">
									<el-option v-for="item in actionTypeOptions" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--3/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.zxyhscl')">
								<el-checkbox v-model="crel.loginUsernumRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.cgzdzxs')" prop="maxUserNum">
								<el-input v-model="crel.loginUsernumRule.maxUserNum" style="width: 100px;" :disabled="!crel.loginUsernumRule.flag"></el-input>
								<span>{{ $t('logicSysManager.rzglzx') }}</span>
							</el-form-item>
							<el-form-item>
								<el-select size="small" v-model="crel.loginUsernumRule.actionType" style="width:100px;" :disabled="!crel.loginUsernumRule.flag">
									<el-option v-for="item in actionTypeOptions" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--4/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.dlsjdcl')">
								<el-checkbox v-model="crel.loginTimeRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.gzrdl')">
								<el-select size="small" v-model="crel.loginTimeRule.workDayFlag" style="width: 85px;" :disabled="!crel.loginTimeRule.flag">
									<el-option v-for="item in yesnoOptions" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
								<span>{{ $t('logicSysManager.sjd') }}</span>
								<el-time-select style="width:90px;" :placeholder="$t('logicSysManager.qssj')" v-model="crel.loginTimeRule.timeRule1" :picker-options="{start: '00:00',step: '00:30',end: '23:59'}"
								 :disabled="!crel.loginTimeRule.flag">
								</el-time-select>
								<el-time-select style="width:90px;" :disabled="!crel.loginTimeRule.flag" :placeholder="$t('logicSysManager.jssj')" v-model="crel.loginTimeRule.timeRule2"
								 :picker-options="{start: '00:00',step: '00:30',end: '23:59',minTime: crel.loginTimeRule.timeRule1}">
								</el-time-select>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--12/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.qdhccl')">
								<el-checkbox v-model="crel.channelExclusiveRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.zxcl')" label-width="120px">
								<el-select size="small" v-model="crel.channelExclusiveRule.timesFlag" style="width:220px;" :disabled="!crel.channelExclusiveRule.flag">
									<el-option v-for="item in channelRule" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
							</el-form-item>

						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--13/13-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.ljxthccl')">
								<el-checkbox v-model="crel.logicSysExclusiveRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.zxcl')" label-width="120px">
								<el-select size="small" v-model="crel.logicSysExclusiveRule.timesFlag" style="width:260px;" :disabled="!crel.logicSysExclusiveRule.flag">
									<el-option v-for="item in logicExclusiveRule" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
							</el-form-item>

						</el-col>
					</el-row>
				</el-tab-pane>

				<el-tab-pane :label="$t('logicSysManager.mmcl')" name="passwordTab">
					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--5/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.qzxgklcl')">
								<el-checkbox v-model="crel.passwdChangeRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.mmyxq')" prop="passwdValidDay">
								<el-input v-model="crel.passwdChangeRule.passwdValidDay" style="width: 50px;" :disabled="!crel.passwdChangeRule.flag"></el-input>
								<span>天到期{{ $t('logicSysManager.rzglzx') }}</span>
							</el-form-item>
							<el-form-item>
								<el-select size="small" v-model="crel.passwdChangeRule.actionType" style="width: 100px;" :disabled="!crel.passwdChangeRule.flag">
									<el-option v-for="item in actionTypeOptions" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--6/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.klfzdcl')">
								<el-checkbox v-model="crel.passwdComplexRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.klbxbh')" prop="type">
								<el-checkbox-group v-model="crel.passwdComplexRule.needFlag">
									<el-checkbox label="number" :disabled="!crel.passwdComplexRule.flag">{{ $t('logicSysManager.sz') }}
									</el-checkbox>
									<el-checkbox label="upperchar" :disabled="!crel.passwdComplexRule.flag">{{ $t('logicSysManager.dxzm') }}
									</el-checkbox>
									<el-checkbox label="lowerchar" :disabled="!crel.passwdComplexRule.flag">{{ $t('logicSysManager.xxzm') }}
									</el-checkbox>
									<el-checkbox label="specchar" :disabled="!crel.passwdComplexRule.flag">{{ $t('logicSysManager.tszf') }}
									</el-checkbox>
								</el-checkbox-group>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--7/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.klcwcl')">
								<el-checkbox v-model="crel.passwdErrorRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.zdcwcs')" prop="passwdTryMax">
								<el-input v-model="crel.passwdErrorRule.passwdTryMax" style="width: 50px;" :disabled="!crel.passwdErrorRule.flag"></el-input>
								<span>{{ $t('logicSysManager.rzglzx') }}</span>
							</el-form-item>
							<el-form-item>
								<el-select size="small" v-model="crel.passwdErrorRule.actionType" style="width: 100px;" :disabled="!crel.passwdErrorRule.flag">
									<el-option v-for="item in actionTypeOptions" :key="item.key" :value="item.key" :label="item.value"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--8/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.klcdcl')">
								<el-checkbox ref="check" v-model="crel.passwdLengthRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.klzdcd')" label-width="190px" prop="passwdLengthMin">
								<el-input v-model="crel.passwdLengthRule.passwdLengthMin" style="width: 50px;" :disabled="!crel.passwdLengthRule.flag"></el-input>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--9/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.klcflscl')">
								<el-checkbox v-model="crel.passwdRepetchgRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.zjcflss')" label-width="190px" prop="passwdRepetchgLastTimes">
								<el-input v-model="crel.passwdRepetchgRule.passwdRepetchgLastTimes" style="width: 50px;" :disabled="!crel.passwdRepetchgRule.flag"></el-input>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--10/12-->
						<el-col :span="8">
							<el-form-item ref="check1" :label="$t('logicSysManager.klbcfcd')">
								<el-checkbox v-model="crel.passwdRepetnumberRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.kljzcfzfs')" label-width="190px" prop="passwdRepetnumber">
								<el-input v-model="crel.passwdRepetnumberRule.passwdRepetnumber" style="width: 50px;" :disabled="!crel.passwdRepetnumberRule.flag"></el-input>
							</el-form-item>
						</el-col>
					</el-row>

					<el-row style="border-bottom:1px solid #bfdaee;margin-top: 20px;">
						<!--11/12-->
						<el-col :span="8">
							<el-form-item :label="$t('logicSysManager.kllxcdcl')">
								<el-checkbox v-model="crel.passwdSequnnumberRule.flag">{{ $t('logicSysManager.qy') }}</el-checkbox>
							</el-form-item>
						</el-col>
						<el-col :span="16">
							<el-form-item :label="$t('logicSysManager.kljzlxzfs')" label-width="190px" prop="passwdSequnnumber">
								<el-input v-model="crel.passwdSequnnumberRule.passwdSequnnumber" style="width: 50px;" :disabled="!crel.passwdSequnnumberRule.flag"></el-input>
							</el-form-item>
						</el-col>
					</el-row>
				</el-tab-pane>
			</el-tabs>

		</el-form>
		<div slot="footer" align="center">
			<el-button type="primary" @click="saveCrelEditFn('crel')">{{ $t('logicSysManager.bc') }}</el-button>
			<el-button @click="dialogCrelVisible = false">{{ $t('logicSysManager.gb') }}</el-button>
		</div>
	</el-dialog-x>
	<el-dialog-x :center="true" :title="$t('logicSysManager.syxz')" :visible.sync="dialogIndexVisible">
		<el-table-x ref="indexTable" :table-columns="indexTable.columns" :data-url="indexTable.url" :defalut-load="false" :radiobox="true">
		</el-table-x>
		<div slot="footer" class="dialog-footer" align="center">
			<el-button type="primary" @click="indexCheck">{{ $t('logicSysManager.qd') }}</el-button>
			<el-button @click="dialogIndexVisible=false">{{ $t('logicSysManager.qx') }}</el-button>
		</div>
	</el-dialog-x>

	<el-dialog-x :center="true" :title="$t('logicSysManager.fzjs')" :visible.sync="roleDialogVisible" top="10px">
		<el-form-q ref="roleQuery" :field-data="roleTable.queryFields" @search-click="queryRoleFn"></el-form-q>
		<el-table-x ref="roleTable" :table-columns="roleTable.columns" :data-url="roleTable.url" :defalut-load="false" :radiobox="true"
		 :base-params="roleTable.params">
		</el-table-x>
		<div slot="footer" class="dialog-footer" align="center">
			<el-button type="primary" @click="roleCheck">{{ $t('logicSysManager.qd') }}</el-button>
			<el-button @click="roleDialogVisible=false">{{ $t('logicSysManager.qx') }}</el-button>
		</div>
		<span style="position:absolute;top:18px;left:97px;color: red;">
			{{ $t('logicSysManager.tsxjxtjfzjsdgnsqxxqzyqr') }}
		</span>
	</el-dialog-x>
	</div>